//package com.cloud.gateway.filter;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.core.Ordered;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
///**
// * 自定义全局GlobalFilter
// * 目的 需要传入uname才能正常访问接口
// * http://localhost:9527/payment/get/11111
// * http://localhost:9527/payment/get/11111?uname=12
// */
//@Component
//@Slf4j
//public class MyLogGatewayFilter implements GlobalFilter, Ordered {
//    @Override
//    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//
//        log.info("******enter MyLogGatewayFilter*********");
//        String uname = exchange.getRequest().getQueryParams().getFirst("uname");
//        if (uname==null) {
//            log.info("uname 不能为空");
//            return exchange.getResponse().setComplete();
//        }
//
//        return chain.filter(exchange);  //传递给下一个
//    }
//
//    @Override
//    public int getOrder() {
//        return 0;
//    }
//}
